package com.you.atlas.web.home.module.screen;

import javax.servlet.http.HttpServletRequest;

import weibo4j.Oauth;
import weibo4j.model.WeiboException;
import weibo4j.util.WeiboConfig;

import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.TurbineRunData;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.alibaba.common.logging.Logger;
import com.alibaba.common.logging.LoggerFactory;

public class SinaSign {

    private Logger LOGGER = LoggerFactory.getLogger(SinaSign.class);
    
    public void execute(@Param(name = "done") String done, HttpServletRequest request, TurbineRunData rundata,
                        Navigator navigator) {
      
        Oauth oauth = new Oauth();
        try {
            String url = oauth.authorize("code");
            navigator.redirectToLocation(url);
        } catch (WeiboException e) {
            LOGGER.error("memberbind",e);
        }
    }
}
